﻿
@{
    Layout = "~/Areas/Platform/Views/Shared/_OrgTreeWindowLayout.cshtml";
}
@section tabContent{

    <section class="content">
        <div class="box box-primary container">
            <div class="box-header with-border">
                <div class="row">
                    <div class="box-tools SearchArea col-md-4 col-sm-12">
                        <form class="input-group input-group-sm SearchArea">
                            <div class="input-group input-group-sm defaultSearch">
                                <input type="text" name="FullName" autocomplete="off" class="form-control pull-right" placeholder="全名">
                                <div class="input-group-btn">
                                    <button type="button" class="btn btn-default" onclick="window.app.search(this);" data-search="#userWindowDataList"><i class="fa fa-search"></i></button>
                                </div>
                            </div>
                            <input name="OrgId" type="hidden" />
                        </form>
                    </div>
                </div>
            </div>
            <div class="box-body no-padding">
                <form id="userWindowDataForm" data-url="@ViewBag.PostUrl">

                    <table id="userWindowDataList" class="table table-bordered table-condensed table-striped table-hover dataTable text-center display nowrap" width="100%"></table>
                </form>
            </div>
        </div>
    </section>

    <script type="text/javascript">
    $(document).ready(function () {
        $('#userWindowDataList').dataTable({
            "serverSide": true,
        displayLength: 10 ,
        "ajax": { "url": "@ViewBag.DataUrl", "type": "POST" },
            "columnDefs": [{ sDefaultContent: '', aTargets: ['_all'] }
            ],
            columns: [
                {
                    title: '', data: 'selected', sortable: false, width: 30, "sClass": 'checkColumn', render: function (data, type, row, meta) {
                        return '<input type="checkbox" value="' + row.id +'" ' + (data == true ?'checked':'') +' />'; }
                },
                { title: '序号', data: null, bSortable: false, targets: 0, width: 50, "sClass": 'rowNumberColumn', render: function (data, type, row, meta) { var startIndex = meta.settings._iDisplayStart; return startIndex + meta.row + 1; } },

             { title: "用户名", data: "userName", width: 150, "sClass": "left", sortable: false },

             { title: "姓名", data: 'person.fullName', width: 160, "sClass": "left" },
             { title: "性别", data: 'person.genderCode', render: function (data, type, row, meta) {
                        var genderCode;
                        if (row.person) genderCode = row.person.genderCode;
                        else genderCode = "";
                        return app.code2Text("Gender", genderCode);
                    },
                    "sClass": "left"
              }

        ]
    });
});
    </script>
}
@section windowfooter{
    <div class="modal-footer no-pad-top">
        <div class="btn-group">
            @Html.Bootstrap().LinkButton("确定", ToolBarIco.Save).Style(BootstrapStyle.Primary).Click(ViewBag.Save).Attribute("data-dismiss", "modal")

            @Html.Bootstrap().LinkButton("关闭", ToolBarIco.Close).Style(BootstrapStyle.Default).Attribute("data-dismiss", "modal")
        </div>
    </div>
}